<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outer {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            align-content: center;
             width: 500px;
            height: 500px;
            background-color: thistle;
        }

        .inner {
            width: 45%;
            height: 40%;
            background-color: wheat;
            border: 1px solid black;
            margin-bottom: 1px;
        }
    </style>
</head>

<body>
    <div class="outer">
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
        <div class="inner"></div>
    </div>
</body>

</html>